//
//  ITShareManager.h
//  ITBE
//
//  Created by figs on 2019/8/6.
//  Copyright © 2019年 鲍利成. All rights reserved.
//

#import <Foundation/Foundation.h>
//#import <ShareSDK/ShareSDKHeader.h>

typedef enum : NSUInteger {
    ITPlatformTypeFB,
    ITPlatformTypeFBMessenger,
    ITPlatformTypeTwiter,
    ITPlatformTypeWhatsapp,
    ITPlatformTypeCopy,
} ITPlatformType;

NS_ASSUME_NONNULL_BEGIN

@interface ITShareModel : NSObject
@property(nonatomic, copy) NSString *showTitle;
@property(nonatomic, strong)NSString *showImageName;
@property(nonatomic, assign)ITPlatformType platformType;
/** 统计type（分享方式）：1.facebook，2.instagram，3.whatsAPP，4.messenger，5.copy link*/
@property(nonatomic, strong)NSString *shareType;

/** 1 详情页askFriend 2sharevideo 3邀请分享  4详情页视频分享... 5详情页视频转发*/
@property(nonatomic, assign)int position;

@property(nonatomic, strong)NSString *videoId;
@property(nonatomic, strong)NSString *title;
@property(nonatomic, strong)NSString *desc;
@property(nonatomic, strong)id image;
@property(nonatomic, strong)id thumImage;
@property(nonatomic, strong)NSString *webPageUrl;

@property(nonatomic, strong)NSString *iconName;

@end
//SSDKResponseState state, SSDKUser *user, NSError *error
typedef void(^AuthorizeBlock)(int state, id user, NSError *error);
typedef void(^ShareBlock)(BOOL success);

@interface ITShareManager : NSObject

+(instancetype)shareManager;

+ (BOOL)isInstallWithPlatforType:(int)platformType;

+ (BOOL)isFBInstall;

+ (NSMutableArray *)supportItems;
+ (ITShareModel *)copyModel;
- (void)install;

- (void)shareWebPageWithModel:(ITShareModel *)model callback:(ShareBlock)callback;

- (void)shareWebPageToPlatformType:(int)platformType title:(NSString *)title description:(NSString *)desc thumImage:(id)image webpageUrl:(NSString *)webpageUrl callback:(ShareBlock)callback;
//
//- (void)authorizeWithPlatforType:(int)platformType authorizeBlock:(AuthorizeBlock)authorizeBlock;
//
//- (void)getUserInfoWithPlatforType:(int)platformType authorizeBlock:(AuthorizeBlock)authorizeBlock;

/**分享url  videoid 为空 则是分享应用*/
+ (NSString *)shareUrlWithEventNo:(NSString *)eventNo shareType:(NSString *)shareType videoId:(NSString *)videoId ;

/**分享埋点*/
+ (void)trackEnentNo:(NSString *)enentNo params:(NSDictionary *)params;


- (void)shareVideo:(id)video;


+ (BOOL)shouldShowShareVideo;
@end

NS_ASSUME_NONNULL_END
